package com.zty.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;

import java.util.Date;

/**
 * @Author ZTY
 * @Description 一个每个PO类中都会使用到的基类，里面都是业务方所不关心的公有属性
 * @Date 1:38 2023-12-12
 **/

@Data
public class BaseEntity {

    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    @TableField(fill = FieldFill.INSERT)
    @TableLogic // 逻辑删除和配置项一一对应
    private Integer deleteFlag;

    //  乐观锁
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

}
